if (TARGET hardware_spi)
    add_subdirectory_exclude_platforms(bme280_spi)
    add_subdirectory_exclude_platforms(mpu9250_spi)
    add_subdirectory_exclude_platforms(spi_dma)
    add_subdirectory_exclude_platforms(spi_master_slave)
    add_subdirectory_exclude_platforms(spi_flash)
    add_subdirectory_exclude_platforms(max7219_32x8_spi)
    add_subdirectory_exclude_platforms(max7219_8x7seg_spi)
else()
    message("Skipping SPI examples as hardware_spi is unavailable on this platform")
endif()